import { Layout } from '@/utils/routerHelper'

const { t } = useI18n()
/**
 * redirect: noredirect        当设置 noredirect 的时候该路由在面包屑导航中不可被点击
 * name:'router-name'          设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题
 * meta : {
 hidden: true              当设置 true 的时候该路由不会再侧边栏出现 如404，login等页面(默认 false)

 alwaysShow: true          当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式，
 只有一个时，会将那个子路由当做根路由显示在侧边栏，
 若你想不管路由下面的 children 声明的个数都显示你的根路由，
 你可以设置 alwaysShow: true，这样它就会忽略之前定义的规则，
 一直显示根路由(默认 false)

 title: 'title'            设置该路由在侧边栏和面包屑中展示的名字

 icon: 'svg-name'          设置该路由的图标

 noCache: true             如果设置为true，则不会被 <keep-alive> 缓存(默认 false)

 breadcrumb: false         如果设置为false，则不会在breadcrumb面包屑中显示(默认 true)

 affix: true               如果设置为true，则会一直固定在tag项中(默认 false)

 noTagsView: true          如果设置为true，则不会出现在tag中(默认 false)

 activeMenu: '/dashboard'  显示高亮的路由路径

 followAuth: '/dashboard'  跟随哪个路由进行权限过滤

 canTo: true               设置为true即使hidden为true，也依然可以进行路由跳转(默认 false)
 }
 **/
const remainingRouter: AppRouteRecordRaw[] = [
  //库存管理
  /*{
    path: '/inventory/rdrecord06Form',
    component:  () => import('@/views/wms/rdrecord06/Rdrecord06Form.vue'),
    name: 'Rrdrecord06Form',
    meta: {
      hidden: false,
      canTo: true,
      noCache: true
    }
  },
  {
    path: '/inventory/rdrecord06FormInfo',
    component:  () => import('@/views/wms/rdrecord06/Rdrecord06Form.vue'),
    name: 'Rrdrecord06FormInfo',
    meta: {
      hidden: true,
      canTo: true,
      noCache: true
    }
  },
  {
    path: '/inventory/rdrecord07Form',
    component:  () => import('@/views/wms/rdrecord07/Rdrecord07Form.vue'),
    name: 'Rrdrecord07Form',
    meta: {
      hidden: false,
      canTo: true,
      noCache: true
    }
  },
  {
    path: '/inventory/rdrecord07FormInfo',
    component:  () => import('@/views/wms/rdrecord07/Rdrecord07Form.vue'),
    name: 'Rrdrecord07FormInfo',
    meta: {
      hidden: true,
      canTo: true,
      noCache: true
    }
  },
  {
    path: '/inventory/rdrecord08Form',
    component:  () => import('@/views/wms/rdrecord08/Rdrecord08Form.vue'),
    name: 'Rrdrecord08Form',
    meta: {
      hidden: false,
      canTo: true,
      noCache: true
    }
  },
  {
    path: '/inventory/rdrecord08FormInfo',
    component:  () => import('@/views/wms/rdrecord08/Rdrecord08Form.vue'),
    name: 'Rrdrecord08FormInfo',
    meta: {
      hidden: true,
      canTo: true,
      noCache: true
    }
  },
  {
    path: '/inventory/rdrecord09Form',
    component:  () => import('@/views/wms/rdrecord09/Rdrecord09Form.vue'),
    name: 'Rrdrecord09Form',
    meta: {
      hidden: false,
      canTo: true,
      noCache: true
    }
  },
  {
    path: '/inventory/rdrecord09FormInfo',
    component:  () => import('@/views/wms/rdrecord09/Rdrecord09Form.vue'),
    name: 'Rrdrecord09FormInfo',
    meta: {
      hidden: true,
      canTo: true,
      noCache: true
    }
  },*/
  {
    path: '/redirect',
    component: Layout,
    name: 'Redirect',
    children: [
      {
        path: '/redirect/:path(.*)',
        name: 'Redirect',
        component: () => import('@/views/Redirect/Redirect.vue'),
        meta: {}
      }
    ],
    meta: {
      hidden: true,
      noTagsView: true
    }
  },
  {
    path: '/',
    component: Layout,
    redirect: '/index',
    name: 'Home',
    meta: {},
    children: [
      {
        path: 'index',
        component: () => import('@/views/Home/Index.vue'),
        name: 'Index',
        meta: {
          title: t('router.home'),
          icon: 'ep:home-filled',
          noCache: false,
          affix: true
        }
      }
    ]
  },
  {
    path: '/user',
    component: Layout,
    name: 'UserInfo',
    meta: {
      hidden: true
    },
    children: [
      {
        path: 'profile',
        component: () => import('@/views/Profile/Index.vue'),
        name: 'Profile',
        meta: {
          canTo: true,
          hidden: true,
          noTagsView: false,
          icon: 'ep:user',
          title: t('common.profile')
        }
      },
      {
        path: 'notify-message',
        component: () => import('@/views/system/notify/my/index.vue'),
        name: 'MyNotifyMessage',
        meta: {
          canTo: true,
          hidden: true,
          noTagsView: false,
          icon: 'ep:message',
          title: '我的站内信'
        }
      }
    ]
  },
  {
    path: '/dict',
    component: Layout,
    name: 'dict',
    meta: {
      hidden: true
    },
    children: [
      {
        path: 'type/data/:dictType',
        component: () => import('@/views/system/dict/data/index.vue'),
        name: 'SystemDictData',
        meta: {
          title: '字典数据',
          noCache: true,
          hidden: true,
          canTo: true,
          icon: '',
          activeMenu: '/system/dict'
        }
      }
    ]
  },
  {
    path: '/bpm',
    component: Layout,
    name: 'bpm',
    meta: {
      hidden: true
    },
    children: [
      {
        path: 'manager/form/edit',
        component: () => import('@/views/bpm/form/editor/index.vue'),
        name: 'BpmFormEditor',
        meta: {
          noCache: true,
          hidden: true,
          canTo: true,
          title: '设计流程表单',
          activeMenu: '/bpm/manager/form'
        }
      },
      {
        path: 'manager/model/edit',
        component: () => import('@/views/bpm/model/editor/index.vue'),
        name: 'BpmModelEditor',
        meta: {
          noCache: true,
          hidden: true,
          canTo: true,
          title: '设计流程',
          activeMenu: '/bpm/manager/model'
        }
      },
      {
        path: 'manager/simple/workflow/model/edit',
        component: () => import('@/views/bpm/simpleWorkflow/index.vue'),
        name: 'SimpleWorkflowDesignEditor',
        meta: {
          noCache: true,
          hidden: true,
          canTo: true,
          title: '仿钉钉设计流程',
          activeMenu: '/bpm/manager/model'
        }
      },
      {
        path: 'manager/definition',
        component: () => import('@/views/bpm/definition/index.vue'),
        name: 'BpmProcessDefinition',
        meta: {
          noCache: true,
          hidden: true,
          canTo: true,
          title: '流程定义',
          activeMenu: '/bpm/manager/model'
        }
      },
      {
        path: 'process-instance/detail',
        // component: () => import('@/views/bpm/processInstance/detail/index_new.vue'), // TODO 芋艿：新审批界面，已适配 simple 模式，未来会适配 bpmn 模式
        component: () => import('@/views/bpm/processInstance/detail/index.vue'),
        name: 'BpmProcessInstanceDetail',
        meta: {
          noCache: true,
          hidden: true,
          canTo: true,
          title: '流程详情',
          activeMenu: '/bpm/task/my'
        },
        props: (route) => ({
          id: route.query.id,
          taskId: route.query.taskId,
          activityId: route.query.activityId
        })
      },
      {
        path: 'oa/leave/create',
        component: () => import('@/views/bpm/oa/leave/create.vue'),
        name: 'OALeaveCreate',
        meta: {
          noCache: true,
          hidden: true,
          canTo: true,
          title: '发起 OA 请假',
          activeMenu: '/bpm/oa/leave'
        }
      },
      {
        path: 'oa/leave/detail',
        component: () => import('@/views/bpm/oa/leave/detail.vue'),
        name: 'OALeaveDetail',
        meta: {
          noCache: true,
          hidden: true,
          canTo: true,
          title: '查看 OA 请假',
          activeMenu: '/bpm/oa/leave'
        }
      }
    ]
  },
  {
    path: '/codegen',
    component: Layout,
    name: 'CodegenEdit',
    meta: {
      hidden: true
    },
    children: [
      {
        path: 'edit',
        component: () => import('@/views/infra/codegen/EditTable.vue'),
        name: 'InfraCodegenEditTable',
        meta: {
          noCache: true,
          hidden: true,
          canTo: true,
          icon: 'ep:edit',
          title: '修改生成配置',
          activeMenu: 'infra/codegen/index'
        }
      }
    ]
  },
 

  {
    path: '/login',
    component: () => import('@/views/Login/Login.vue'),
    name: 'Login',
    meta: {
      hidden: true,
      title: t('router.login'),
      noTagsView: true
    }
  },
  {
    path: '/sso',
    component: () => import('@/views/Login/Login.vue'),
    name: 'SSOLogin',
    meta: {
      hidden: true,
      title: t('router.login'),
      noTagsView: true
    }
  },
  {
    path: '/social-login',
    component: () => import('@/views/Login/SocialLogin.vue'),
    name: 'SocialLogin',
    meta: {
      hidden: true,
      title: t('router.socialLogin'),
      noTagsView: true
    }
  },
  {
    path: '/403',
    component: () => import('@/views/Error/403.vue'),
    name: 'NoAccess',
    meta: {
      hidden: true,
      title: '403',
      noTagsView: true
    }
  },
  {
    path: '/404',
    component: () => import('@/views/Error/404.vue'),
    name: 'NoFound',
    meta: {
      hidden: true,
      title: '404',
      noTagsView: true
    }
  },
  {
    path: '/500',
    component: () => import('@/views/Error/500.vue'),
    name: 'Error',
    meta: {
      hidden: true,
      title: '500',
      noTagsView: true
    }
  },

  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/Error/404.vue'),
    name: '',
    meta: {
      title: '404',
      hidden: true,
      breadcrumb: false
    }
  },
  {
    path: '/iot',
    component: Layout,
    name: 'IOT',
    meta: {
      hidden: true
    },
    children: [
      {
        path: 'product/detail/:id',
        name: 'IoTProductDetail',
        meta: {
          title: '产品详情',
          noCache: true,
          hidden: true,
          activeMenu: '/iot/product'
        },
        component: () => import('@/views/iot/product/detail/index.vue')
      },
      {
        path: 'device/detail/:id',
        name: 'IoTDeviceDetail',
        meta: {
          title: '设备详情',
          noCache: true,
          hidden: true,
          activeMenu: '/iot/device'
        },
        component: () => import('@/views/iot/device/detail/index.vue')
      }
    ]
  },

  {
    path: '/job',
    component: Layout,
    name: 'JobL',
    meta: {
      hidden: true
    },
    children: [
      {
        path: 'job-log',
        component: () => import('@/views/infra/job/logger/index.vue'),
        name: 'InfraJobLog',
        meta: {
          noCache: true,
          hidden: true,
          canTo: true,
          icon: 'ep:edit',
          title: '调度日志',
          activeMenu: 'infra/job/index'
        }
      }
    ]
  },
  {
    path: '/order',
    component: Layout,
    name: 'order',
    meta: {
      hidden: true
    },
    children: [
      {
        path: 'pomainIndex',
        component: () => import('@/views/wms/pomain/index.vue'),
        name: 'pomainIndex',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          title: t('采购订单')
        }
      },

      {
        path: 'pomainFormUpdate',
        component: () => import('@/views/wms/pomain/PomainForm.vue'),
        name: 'pomainFormUpdate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          title: t('采购订单修改')
        }
      },
      {
        path: 'pomainFormCreate',
        component: () => import('@/views/wms/pomain/PomainForm.vue'),
        name: 'pomainFormCreate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          title: t('采购订单新增')
        }
      },
      {
        path: 'pomainFormSelect',
        component: () => import('@/views/wms/pomain/PomainForm.vue'),
        name: 'pomainFormSelect',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          title: t('采购订单查看')
        }
      },
      {
        path: 'rdrecord01FormCreate',
        component: () => import('@/views/wms/rdrecord01/Rdrecord01Form.vue'),
        name: 'rdrecord01FormCreate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('采购入库新增')
        }
      },
      {
        path: 'rdrecord01FormUpdate',
        component: () => import('@/views/wms/rdrecord01/Rdrecord01Form.vue'),
        name: 'rdrecord01FormUpdate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('采购入库修改')
        }
      },
      {
        path: 'rdrecord01FormSelect',
        component: () => import('@/views/wms/rdrecord01/Rdrecord01Form.vue'),
        name: 'rdrecord01FormSelect',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('采购入库查看')
        }
      },
      {
        path: 'rdrecord01Index',
        component: () => import('@/views/wms/rdrecord01/index.vue'),
        name: 'rdrecord01Index',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,

          icon: 'ep:user',
          title: t('采购入库')
        }
      },
      {
        path: 'rdrecord10FormCreate',
        component: () => import('@/views/wms/rdrecord10/Rdrecord10Form.vue'),
        name: 'rdrecord10FormCreate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('生产入库新增')
        }
      },
      {
        path: 'rdrecord10FormUpdate',
        component: () => import('@/views/wms/rdrecord10/Rdrecord10Form.vue'),
        name: 'rdrecord10FormUpdate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('生产入库修改')
        }
      },
      {
        path: 'rdrecord10FormSelect',
        component: () => import('@/views/wms/rdrecord10/Rdrecord10Form.vue'),
        name: 'rdrecord10FormSelect',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('生产入库查看')
        }
      },
      {
        path: 'rdrecord10Index',
        component: () => import('@/views/wms/rdrecord10/index.vue'),
        name: 'rdrecord10Index',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,

          icon: 'ep:user',
          title: t('生产入库')
        }
      },
      {
        path: 'rdrecord32FormCreate',
        component: () => import('@/views/wms/rdrecord32/Rdrecord32Form.vue'),
        name: 'rdrecord32FormCreate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('销售出库新增')
        }
      },
      {
        path: 'rdrecord32FormUpdate',
        component: () => import('@/views/wms/rdrecord32/Rdrecord32Form.vue'),
        name: 'rdrecord32FormUpdate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('销售出库修改')
        }
      },
      {
        path: 'rdrecord32FormSelect',
        component: () => import('@/views/wms/rdrecord32/Rdrecord32Form.vue'),
        name: 'rdrecord32FormSelect',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('销售出库查看')
        }
      },
      {
        path: 'rdrecord32Index',
        component: () => import('@/views/wms/rdrecord32/index.vue'),
        name: 'rdrecord32Index',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,

          icon: 'ep:user',
          title: t('销售出库')
        }
      },

      {
        path:'saleOrderFormCreate',
        component: () => import('@/views/wms/saleorder/SaleOrderForm.vue'),
        name: 'saleOrderFormCreate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          title: t('销售订单新增')
        }
      },
      {
        path:'saleOrderFormUpdate',
        component: () => import('@/views/wms/saleorder/SaleOrderForm.vue'),
        name: 'saleOrderFormUpdate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          title: t('销售订单修改')
        }
      },
      {
        path:'saleOrderFormSelect',
        component: () => import('@/views/wms/saleorder/SaleOrderForm.vue'),
        name: 'saleOrderFormSelect',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          title: t('销售订单查看')
        }
      },
      {
        path:'saleOrderIndex',
        component: () => import('@/views/wms/saleorder/index.vue'),
        name: 'saleOrderIndex',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          title: t('销售订单')
        }
      },
      {
        path: 'productionorder',
        component: () => import('@/views/wms/productionorder/index.vue'),
        name: 'productionorder',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
        
          icon: 'ep:user',
          title: t('生产任务')
        }
      },
      
      {
        path: 'productionOrderFormCreate',
        component: () => import('@/views/wms/productionorder/ProductionOrderForm.vue'),
        name: 'productionOrderFormCreate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('生产任务新增')
        }
      },

      {
        path: 'productionOrderFormUpdate',
        component: () => import('@/views/wms/productionorder/ProductionOrderForm.vue'),
        name: 'productionOrderFormUpdate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('生产任务修改')
        }
      },

      {
        path: 'productionOrderFormSelect',
        component: () => import('@/views/wms/productionorder/ProductionOrderForm.vue'),
        name: 'productionOrderFormSelect',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('生产任务查看')
        }
      },
      {
        path: 'checkvouchFormCreate',
        component: () => import('@/views/wms/checkvouch/CheckvouchForm.vue'),
        name: 'checkvouchFormCreate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('盘点订单新增')
        }
      },
      {
        path: 'checkvouchFormUpdate',
        component: () => import('@/views/wms/checkvouch/CheckvouchForm.vue'),
        name: 'checkvouchFormUpdate',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('盘点订单修改')
        }
      },
      {
        path: 'checkvouchFormSelect',
        component: () => import('@/views/wms/checkvouch/CheckvouchForm.vue'),
        name: 'checkvouchFormSelect',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('盘点订单查询')
        }
      },
      {
        path: 'checkvouchIndex',
        component: () => import('@/views/wms/checkvouch/index.vue'),
        name: 'checkvouchIndex',
        meta: {
          noCache: false,
          hidden: true,
          canTo: true,
          icon: 'ep:user',
          title: t('盘点订单')
        }
      },
    ]
  },





]

export default remainingRouter
